import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/css/global.css'
import axios from './utils/request'

Vue.config.productionTip = false

Vue.prototype.$http=axios
Vue.prototype.$message=ElementUI.Message

Vue.prototype.$axios = axios


if(localStorage.getItem("currentUser")&&localStorage.getItem("token")){
  store.commit("LoginModule/setUser",JSON.parse(localStorage.getItem("currentUser")));
  store.commit("LoginModule/setToken",localStorage.getItem("token"));
}

Vue.use(ElementUI);
// new Vue({
//   router,
//   store,
//   render: h => h(App)
// }).$mount('#app')
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})